<!DOCTYPE html>
<html>
     
  
    <head>
        <title >这是一个测试</title>
    </head>
    <body>

        <h3 id="title">
            <p><a oncontextmenu="myFunction()">这是一个标题11111</a>ppppp</p>
        </h3>
        <script>

            function myFunction() {
                console.log('a is right click!')
            }
            x = new Array()
            x.length
            x = []
            x = null  // 
            x = undefined
            // isNaN is not a number
            // 数据类型 ：  String, Number, undefined, null, Object, Boolean,
            console.log(isNaN( x))

            data = {
                aaa: '88',
                bbb: "0asdf",
                ccc: true
            }
            console.log( 5+6 +"5" )
            res = JSON.stringify(data)
            console.log(res)

            console.log(typeof data.ccc)

            // let dom = document.getElementById("title").innerText = "这是 innerText"  // innerHTML
            var x = 6 + 6  ;  // 512    125
            // console.log(typeof x)   // 566
            // if (x > 10) {
            //     console.info("大于10")
            // } else {
            //     console.log("小于等于10")
            // }

            // if (x > 10) {
            //     console.info("大于10")
            // } else if (x == 10) {
            //     console.log("等于10")
            // } else {
            //     console.log("小于10")
            // }
            // 最高  99
            // >= 90 优秀    >= 80 及格     不及格
            // parseInt   9.67    “98fsdfd”
            // x 必须小于 20 
            x = 90
            switch (parseInt(x / 10)) {
                case 9:
                    console.log("优秀")
                    break;
                case 8:
                    console.log("及格")
                    break;
                default:
                    console.log("不及格")
            }

            let cars = ["red", "black", "blue", "green"]; 

            for (let i = 0; i < cars.length; i++) { 
                // document.write(cars[i] + "<br>");
            }

            // 循环获取key
            // for (const k in cars) { 
            //     // key
            //     // console.log(k)
            //     console.log(cars[k])
            // }
            // 循环获取value
            // for (const v of cars) { 
            //     // key
            //     // console.log(k)
            //     console.log(v)
            // }
            console.log(add(5,6))
            // 函数, 函数在下面也能执行时因为编译器先把里面的js 
            // 代码加载到内存后再从上往下执行
            function add(a, b) {
                return a+b
            }
            let yy;
            function print(yy) {
                yy = 0
                console.log(yy)
            }
            console.log(yy)
            // 匿名函数 就是没有函数名
            let jia = add

            // let c = function (a, b) {
            //     return a+b
            // }
            // =
            // function c(a, b) {
            //     return a+b
            // }
            // 继续变, 去掉function 关键字， 加个箭头
            // 代码里面尽量使用箭头函数， 自己查下   this
            // let c = (a, b) => {
            //     return a+b
            // }
            // 简化
            let c = (a, b) => a + b

         
            // print(c(6,7))
        
        </script>
        <!-- <p href="default.htm">aaaaaaefvbbbbb</p>
        <a href="default.htm">aaaaaaaaaa</a>66666
        <img src="">  -->
        <form class="form">

        </form>
  
        <input type="text" />

        <table >
            <tr> 
                <th>name</th>
                <th>age</th>
                <th>身高</th>
            </tr>
            <tr> 
                <td>张三</td>
                <td>19</td>
                <td>1.75</td>
            </tr>
            <tr> 
                <td>卓琪</td>
                <td>19</td>
                <td>1.63</td>
            </tr>
            
        </table>
    </body>
</html>

<!-- // 数据类型     if     for     函数    -->


<style>
   th, td {
        border: 1px solid black;
    }
</style>

<script>
    let b = new Map()
    const http = new XMLHttpRequest();
    const url = 'https://www.jianshu.com/shakespeare/notes/6291468/included_collections?page=1&count=7'
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    // http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    http.open('GET', url)
    http.send()
    let a = {
        "aaa": 1,
        "bbb": 2
    }

    let b = {
        "bbb": 2,
        "aaa": 1
    }

    
    const stat =  http.readyState

    // http.responseText
    console.log(stat)
</script>
